<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新建快捷运单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="../plugins/layui/css/myPage.css"/>
    <style>
        .thumb {width:220px;height: 200px}

    </style>
</head>
<body  >
<div class="layui-container">


    <form class="layui-form">
        <div class="layui-row">
            <div class="layui-col-md12">

                <fieldset class="layui-elem-field" style="margin-top: 20px;">
                    <legend>基本信息</legend>


                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 90px">身份证号 </label>
                        <div class="layui-input-inline" style="width: 200px;">
                            <input   type="text" name="sfzh"    class="layui-input" id="sfzh" >

                            <!--<input   type="hidden" name="sjid"  >-->
                            <!--<input   type="hidden" name="sfcz" value="1"  >-->
                            <!--<input   type="hidden" name="sfscdd" value="1"  >-->
                        </div>


                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 73px" >姓名</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input name="xingming"  id="xingming"  class="layui-input" >

                                </input>
                            </div>
                        </div>



                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 73px" >籍贯</label>
                            <div class="layui-input-inline" style="width: 250px;">
                                <input name="jiguan"  id="jiguan"  class="layui-input" >

                                </input>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 73px" >村</label>
                            <div class="layui-input-inline" style="width: 100px;">
                                <input name="cun"  id="cun"  class="layui-input" >

                                </input>
                            </div>
                        </div>


                    </div>
                    <div class="layui-form-item">

                        <label class="layui-form-label" style="width: 150px;">驾驶证年检日期</label>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input   type="text" name="jsznjrq"     class="layui-input" id="jsznjrq" >
                        </div>

                        <label class="layui-form-label" style="width: 170px;">从业资格证年检日期</label>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input   type="text" name="cyzgznjrq"      class="layui-input" id="cyzgznjrq" >
                        </div>




                        <label class="layui-form-label" style="width: 75px">手机号</label>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input   type="text" name="sjhm"      class="layui-input" id="sjhm" >
                        </div>

                    </div>




                </fieldset>
            </div>
        </div>

        <div class="layui-row">
            <div class="layui-col-md12">

                <fieldset class="layui-elem-field" style="margin-top: 20px;">
                    <legend>照片信息</legend>

                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <div class= layui-input-block >
                            <label class="layui-form-label"  >身份证正面</label>
                                <input type="hidden" name="sfzzm" id="sfzzm">
                                <!--<button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="sfzzmBtn" style="display: none">上传文件</button>-->
                                <!--<button type="button" class="layui-btn layui-btn-normal "   id="looksfzzmBtn" >查看照片</button>-->
                                <div  id='looksfzzmBtn' title=''></div>
                                <button type="button" class="layui-btn  layui-btn-normal"   id="sfzzmdown" style="margin-top: 5px"  >下载照片</button>
                            </div>

                        </div>

                        <div class="layui-inline">
                            <div class= layui-input-block >
                                <label class="layui-form-label"  >身份证反面</label>
                                <input type="hidden" name="sfzfm" id="sfzfm">
                                <!--<button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="sfzzmBtn" style="display: none">上传文件</button>-->
                                <!--<button type="button" class="layui-btn layui-btn-normal "   id="looksfzzmBtn" >查看照片</button>-->
                                <div  id='looksfzfmBtn' title=''></div>
                                <button type="button" class="layui-btn  layui-btn-normal "   id="sfzfmdown" style="margin-top: 5px"  >下载照片</button>
                            </div>
                        </div>


                        <div class="layui-inline">
                            <div class= layui-input-block >
                                <label class="layui-form-label"  >手举身份证上半身照</label>
                                <input type="hidden" name="sjsfzsbsz" id="sjsfzsbsz">
                                <!--<button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="sfzzmBtn" style="display: none">上传文件</button>-->
                                <!--<button type="button" class="layui-btn layui-btn-normal "   id="looksfzzmBtn" >查看照片</button>-->
                                <div  id='looksjsfzsbszBtn' title=''></div>
                                <button type="button" class="layui-btn  layui-btn-normal "   id="sjsfzsbszdown" style="margin-top: 5px"  >下载照片</button>
                            </div>

                        </div>


                    </div>

                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <div class= layui-input-block >
                                <label class="layui-form-label"  >驾驶证正本</label>
                                <input type="hidden" name="jszzb" id="jszzb">
                                <!--<button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="sfzzmBtn" style="display: none">上传文件</button>-->
                                <!--<button type="button" class="layui-btn layui-btn-normal "   id="looksfzzmBtn" >查看照片</button>-->
                                <div  id='lookjszzbBtn' title=''></div>
                                <button type="button" class="layui-btn  layui-btn-normal "   id="jszzbdown" style="margin-top: 5px"  >下载照片</button>
                            </div>

                        </div>

                        <div class="layui-inline">
                            <div class= layui-input-block >
                                <label class="layui-form-label"  >驾驶证副本</label>
                                <input type="hidden" name="jszfb" id="jszfb">
                                <!--<button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="sfzzmBtn" style="display: none">上传文件</button>-->
                                <!--<button type="button" class="layui-btn layui-btn-normal "   id="looksfzzmBtn" >查看照片</button>-->
                                <div  id='lookjszfbBtn' title=''></div>
                                <button type="button" class="layui-btn  layui-btn-normal "   id="jszfbdown" style="margin-top: 5px"  >下载照片</button>
                            </div>
                        </div>


                        <div class="layui-inline">
                            <div class= layui-input-block >
                                <label class="layui-form-label" style="width: 110px" >从业资格证1</label>
                                <input type="hidden" name="cyzgz1" id="cyzgz1">
                                <!--<button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="sfzzmBtn" style="display: none">上传文件</button>-->
                                <!--<button type="button" class="layui-btn layui-btn-normal "   id="looksfzzmBtn" >查看照片</button>-->
                                <div  id='lookcyzgz1Btn' title=''></div>
                                <button type="button" class="layui-btn  layui-btn-normal "   id="cyzgz1down" style="margin-top: 5px"  >下载照片</button>
                            </div>

                        </div>

                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline" id="2hao">
                            <div class= layui-input-block >
                                <label class="layui-form-label" style="width: 110px" >从业资格证2</label>
                                <input type="hidden" name="cyzgz2" id="cyzgz2">
                                <!--<button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="sfzzmBtn" style="display: none">上传文件</button>-->
                                <!--<button type="button" class="layui-btn layui-btn-normal "   id="looksfzzmBtn" >查看照片</button>-->
                                <div  id='lookcyzgz2Btn' title=''></div>
                                <button type="button" class="layui-btn  layui-btn-normal "   id="cyzgz2down" style="margin-top: 5px"  >下载照片</button>
                            </div>


                        </div> <div class="layui-inline" id="3hao">
                        <div class= layui-input-block >
                            <label class="layui-form-label" style="width: 110px" >从业资格证3</label>
                            <input type="hidden" name="cyzgz3" id="cyzgz3">
                            <!--<button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="sfzzmBtn" style="display: none">上传文件</button>-->
                            <!--<button type="button" class="layui-btn layui-btn-normal "   id="looksfzzmBtn" >查看照片</button>-->
                            <div  id='lookcyzgz3Btn' title=''></div>
                            <button type="button" class="layui-btn  layui-btn-normal "   id="cyzgz3down" style="margin-top: 5px"  >下载照片</button>
                        </div>


                    </div>

                        <div class="layui-inline" id="4hao">
                            <div class= layui-input-block >
                                <label class="layui-form-label" style="width: 110px" >从业资格证4</label>
                                <input type="hidden" name="cyzgz4" id="cyzgz4">
                                <!--<button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="sfzzmBtn" style="display: none">上传文件</button>-->
                                <!--<button type="button" class="layui-btn layui-btn-normal "   id="looksfzzmBtn" >查看照片</button>-->
                                <div  id='lookcyzgz4Btn' title=''></div>
                                <button type="button" class="layui-btn  layui-btn-normal "   id="cyzgz4down" style="margin-top: 5px"  >下载照片</button>
                            </div>

                    </div>
                        <div class="layui-inline"  id="5hao">
                            <div class= layui-input-block >
                                <label class="layui-form-label" style="width: 110px" >从业资格证5</label>
                                <input type="hidden" name="cyzgz5" id="cyzgz5">
                                <!--<button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="sfzzmBtn" style="display: none">上传文件</button>-->
                                <!--<button type="button" class="layui-btn layui-btn-normal "   id="looksfzzmBtn" >查看照片</button>-->
                                <div  id='lookcyzgz5Btn' title=''></div>
                                <button type="button" class="layui-btn  layui-btn-normal "   id="cyzgz5down" style="margin-top: 5px"  >下载照片</button>
                            </div>
                        </div>




                    </div>






                </fieldset>
            </div>


        </div>



        <div class="layui-row">
            <div class="layui-col-md12">

                <fieldset class="layui-elem-field" style="margin-top: 20px;">
                    <legend>审核</legend>


                    <div class="layui-form-item">


                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 90px" ><span style="color: red;">*</span>审核结果</label>
                            <input   type="hidden" name="sjid"  >
                            <div class="layui-input-inline" style="width: 150px;">
                                <select name="shzt"    id="shzt" lay-filter="shzt" >
                                    <option value="未审核"></option>
                                    <option value="审核通过">通过</option>
                                    <option value="审核不通过">不通过</option>
                                </select>
                            </div>
                        </div>





                    </div>
                    <div class="layui-form-item">
                    <div class="layui-inline"  style="display: none" id="reason">
                        <label class="layui-form-label" style="width: 60px"><span style="color: red;">*</span>原因</label>
                        <div class="layui-input-inline" style="width: 500px;">
                            <textarea   type="text" name="yuanyin"       placeholder="请输入内容" class="layui-textarea" id="yuanyin" ></textarea>

                        </div>
                    </div>

                    </div>




                    <div class="layui-form-item">


                        <div class="layui-inline"  >
                            <label class="layui-form-label" style="width: 70px">审核人</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input   type="text" name="shr"    class="layui-input" id="shr" >

                            </div>
                        </div>

                        <div class="layui-inline"  >
                            <label class="layui-form-label" style="width: 90px">审核日期</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input   type="text" name="shrq"    class="layui-input" id="shrq" >

                            </div>
                        </div>


                    </div>





                </fieldset>
            </div>


        </div>

        <button id="modiSub" class="layui-btn layui-btn-normal layui-btn-disabled layui-hide"  display lay-submit lay-filter="update" style="width: 10%; position: absolute;left: 45%"  >立即提交</button>

    </form>
</div>

<script src="../plugins/layui/layui.js"></script>

<script src="../js/config.js"></script>
<script src="../js/tools.js"></script>

<script>

    layui.use(['table','form','element','laydate','upload'],function () {
        var $ = layui.$;
        var table = layui.table;
        var form = layui.form;
        var element = layui.element;
        var laydate = layui.laydate;
        var upload = layui.upload;

        $(".layui-input").addClass("layui-disabled");
        $(".layui-input").attr("disabled",true);
        $(".layui-textarea").addClass("layui-disabled");
        $(".layui-textarea").attr("disabled",true);
        $("#shzt").attr("disabled","disabled");

        if($("#shzt").val() == "未审核"){
            $("#shzt").removeAttr("disabled","disabled");
            $("#modiSub").removeClass("layui-btn-disabled");
            $("#modiSub").attr("disabled",false);
            $("#modiSub").removeClass("layui-hide")
            $("#modiSub").addClass("layui-show")
            }else  if($("#shzt").val() == "审核不通过"){
            $("#reason").show();
        }
        if($("#cyzgz2").val() == ""||$("#cyzgz2").val() ==null){
            $("#2hao").hide();
            // $("#cyzgz2down").addClass("layui-btn-disabled");
            // $("#cyzgz2down").attr("disabled",true);
        }
        if($("#cyzgz3").val() == ""||$("#cyzgz3").val() ==null){
            $("#3hao").hide();

            // $("#lookcyzgz2Btn").hide();
            // $("#lookcyzgz3Btn").attr("disabled",true);
            // $("#cyzgz3down").addClass("layui-btn-disabled");
            // $("#cyzgz3down").attr("disabled",true);
        }
        if($("#cyzgz4").val() == ""||$("#cyzgz4").val() ==null){
            $("#4hao").hide();

            // $("#lookcyzgz2Btn").hide();
            // $("#lookcyzgz4Btn").attr("disabled",true);
            // $("#cyzgz4down").addClass("layui-btn-disabled");
            // $("#cyzgz4down").attr("disabled",true);
        }
        if($("#cyzgz5").val() == ""||$("#cyzgz5").val() ==null){
            $("#5hao").hide();

            // $("#lookcyzgz2Btn").hide();
            // $("#lookcyzgz5Btn").attr("disabled",true);
            // $("#cyzgz5down").addClass("layui-btn-disabled");
            // $("#cyzgz5down").attr("disabled",true);
        }

// 判断是否通过
        form.on('select(shzt)',function (data) {
            if(data.value == "审核通过"){
                $("#reason").hide();
            }else {
                $("#reason").show();
                $("#yuanyin").removeClass("layui-disabled");
                $("#yuanyin").removeAttr("disabled",true);
            }
        });



        //日期控件渲染
        laydate.render({
            elem: '#shrq' //指定元素
            ,theme:'#0099FF'
            ,value: getFormatDate()
            ,type: 'date'
            ,format:'yyyy-MM-dd'
        });
//自动获取经手人
        $.ajax({
            url: contextPath+"/currentUser",
            type: "GET",
            contentType:"application/json;charset=utf-8",
            dataType:"json",
            success: function(res) {
                currentUser = res.yhm;
                console.log(res);
                $("#shr").val(currentUser);
            }
        });

        lookFile($,layer,"sfzzm");
        lookFile($,layer,"sfzfm");
        lookFile($,layer,"sjsfzsbsz");
        lookFile($,layer,"jszzb");
        lookFile($,layer,"jszfb");
        lookFile($,layer,"cyzgz1");
        lookFile($,layer,"cyzgz2");
        lookFile($,layer,"cyzgz3");
        lookFile($,layer,"cyzgz4");
        lookFile($,layer,"cyzgz5");

        download($,layer,"sfzzm");
        download($,layer,"sfzfm");
        download($,layer,"sjsfzsbsz");
        download($,layer,"jszzb");
        download($,layer,"jszfb");
        download($,layer,"cyzgz1");
        download($,layer,"cyzgz2");
        download($,layer,"cyzgz3");
        download($,layer,"cyzgz4");
        download($,layer,"cyzgz5");

        divphoto2($,layer,"sfzzm");
        divphoto2($,layer,"sfzfm");
        divphoto2($,layer,"sjsfzsbsz");
        divphoto2($,layer,"jszzb");
        divphoto2($,layer,"jszfb");
        divphoto2($,layer,"cyzgz1");
        divphoto2($,layer,"cyzgz2");
        divphoto2($,layer,"cyzgz3");
        divphoto2($,layer,"cyzgz4");
        divphoto2($,layer,"cyzgz5");




        // $.ajax({
        //     url: contextPath+"/files/"+$("#sfzzm").val(),
        //     type: "GET",
        //     contentType:"application/json;charset=utf-8",
        //
        //     dataType:"json",
        //     success: function(res) {
        //         console.log(res);
        //         if(res){
        //             var sfzzm = new Image(); //创建新img对象
        //             sfzzm.src = '../files/'+ res.fileurl; //指定数据源
        //             sfzzm.className = 'thumb';
        //             document.getElementById("looksfzzmBtn").appendChild(sfzzm); //添加到预览区域
        //         }else {
        //             layer.msg("文件不存在！");
        //         }
        //
        //     }
        //
        //
        // });
//渲染select
//


//判断是不是已经回单

        // if($("#ydzt").val() != "已完成") {
        //     $("#ykh,#srqt,#ykh,#cyk,#srqt,#huihuo,#hhbh,#sryf,#zsr,#srbz,#glf,#xjjy,#buzhu,#maidan,#sgcl,#tcf,#zsf,#zxf,#chuanpiao,#wzfk,#peijian,#zcqt,#wxfycn,#wxfycw,#zcsx,#zzc,#zcbz,#hdh").attr("disabled",false);
        //
        //     $("#ykh,#srqt,#ykh,#cyk,#srqt,#huihuo,#hhbh,#sryf,#zsr,#srbz,#glf,#xjjy,#buzhu,#maidan,#sgcl,#tcf,#zsf,#zxf,#chuanpiao,#wzfk,#peijian,#zcqt,#wxfycn,#wxfycw,#zcsx,#zzc,#zcbz,#hdh").removeClass("layui-disabled");
        //     $("#modiSub").removeClass("layui-btn-disabled");
        //     $("#modiSub").attr("disabled",false);
        // }
        form.render('select');
// 日期选择器




//提交
        form.on('submit(update)', function(data){
            $("input").css("border","");
            console.log(data.field);
            $.ajax({
                url: contextPath+"/driverapp",
                type: "PUT",
                contentType:"application/json;charset=utf-8",
                data: JSON.stringify(data.field) ,
                dataType:"json",
                success: function(res) {
                    updateSuccess($,layer,res)
                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });



    });

</script>
</body>
</html>